/*
 * @lc app=leetcode.cn id=587 lang=cpp
 *
 * [587] 安装栅栏
 */
#include "include.h"
// @lc code=start
class Solution {
public:
    vector<vector<int>> outerTrees(vector<vector<int>>& trees) {
        // trees[i] = [xi, yi]
        visited_.resize(trees.size(), 0);

        float last_k = 1e9;
        float current_k;
        int startIndex = findNextVertexIndex(0, 0, trees, last_k, current_k);
        last_k = current_k;
        int nextIndex = findNextVertexIndex(trees[startIndex][0], trees[startIndex][1], trees, last_k, current_k);

        while (nextIndex != startIndex){
            nextIndex = findNextVertexIndex(trees[startIndex][0], trees[startIndex][1], trees, last_k, current_k);
            last_k = current_k;
        }

        return vertex_;
    }
private:
    vector<uint8_t> visited_;
    vector<vector<int>> vertex_;
private:
    int findNextVertexIndex(int x, int y, vector<vector<int>>& trees, float last_k, float& current_k){
        ;
        // todo : when x1 = x2 , k=>infinity ~
    }
};
// @lc code=end

